﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../CSS/style1.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/style4.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.showModalDialog.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.pager.js" type="text/javascript"></script>
    <script type="text/javascript">
        function date2str(date) {
            //null判断
            if (date == null) return "";
            //去掉左右的斜杠
            date = date.replace(/\//g, "");
            //将其转为一个日期对象
            eval("var d = new " + date + ";");
            //返回最终结果
            return d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
        }
        
        $(function () {
            load();
            //load2();
            //load3();

        })
        //得到ID
        var ID = window.dialogArguments.id;
        function load() {
            //通过id将资料从数据库中查询出来
            $.ajax({
                url: "ServiceCreate.asmx/VServiceType",
                type: "post",
                data: JSON.stringify({ id: parseInt(ID) }),
                dataType: "json",
                contentType: "application/json",
                success: function (obj) {
                    $("#Label1").text(obj.d.CusID) || "";
                    $("#Label2").text(obj.d.STName) || "";
                    $("#Label3").text(date2str(obj.d.CSCreateDate)) || "";
                    $("#Label4").text(obj.d.CSCreateName) || "";
                    $("#Label5").text(obj.d.CSTitle) || "";
                    $("#Label6").text(obj.d.CSDesc) || "";
                    if (obj.d.CSDealDate == null || obj.d.CSDealDate == "") {
                        alert("您还没有处理!" + "请您去服务处理界面进行填写服务处理！");
                        window.close();
                    } else if (obj.d.CSResult == null || obj.d.CSSatisfy==null) {
                        alert("请您去服务反馈界面进行填写服务结果和满意度！");
                        window.close();
                    }else {
                        $("#Label7").text(date2str(obj.d.CSDealDate)) || "";
                        $("#Label8").text(obj.d.CSDueName) || "";
                        $("#Label9").text(obj.d.CSResult) || "";
                        if (obj.d.CSSatisfy == " ") $("#Label10").text("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") || "";
                        if (obj.d.CSSatisfy == "1") $("#Label10").text("★") || "";
                        if (obj.d.CSSatisfy == "2") $("#Label10").text("★★") || "";
                        if (obj.d.CSSatisfy == "3") $("#Label10").text("★★★") || "";
                        if (obj.d.CSSatisfy == "4") $("#Label10").text("★★★★") || "";
                        if (obj.d.CSSatisfy == "5") $("#Label10").text("★★★★★") || "";
                    }
                    
                }, error: function (xmlhttp) {
                    alert("错误：" + xmlhttp.responseText);
                }
            });

        }
    </script>
</head>
<body>
    <table class="tableEdit" id="tab" style="width: 500px;">
        <thead>
            <tr>
                <td colspan="4">
                    服务信息
                </td>
            </tr>
        </thead>
        <tr>
            <th>客户编号：</th>
            <td>
               <label id="Label1"></label></td>
            <th>服务类型：</th>
            <td>
                <label id="Label2"></label>
            </td>
        </tr>
        <tr>
            <th>创建时候：</th>
            <td>
                <label id="Label3"></label>
            </td>
            <th>创建人：</th>
            <td>
                <label id="Label4"></label>
            </td>
        </tr>
        <tr>
            <th>服务概要：</th>
            <td colspan="3">
               <label id="Label5"></label>
             </td>
        </tr>
        <tr>
            <th>详细信息：</th>
            <td colspan="3">
                <label id="Label6"></label>
             </td>
        </tr>
    </table>
    <table class="tableEdit" id="tb2" style="width: 500px;">
        <thead>
            <tr>
                <td colspan="4">
                    服务处理
                </td>
            </tr>
        </thead>
        <tr>
            <th>处理时间：</th>
            <td>
               <label id="Label7"></label>
            </td>
            <th>处理人：</th>
            <td>
                <label id="Label8"></label>
            </td>
        </tr>
    </table>
    <table class="tableEdit" id="tb3" style="width: 500px;">
        <thead>
            <tr>
                <td colspan="4">
                    服务反馈
                </td>
            </tr>
        </thead>
        <tr>
            <th>处理结果：</th>
            <td>
                <label id="Label9"></label>
             </td>
            <th>满意度：</th>
            <td>
                <label id="Label10"></label>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <input type="button" value="关闭" onclick="window.close()" />
            </td>
        </tr>
    </table>
</body>
</html>
